package com.heg.bk.control;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.heg.bk.service.MobilelUserManagerService;
import com.comm.util.pages.PageUtils;

/**
 * 移动端用户 -- 后台管理控制层
 * @author dengxuzhao
 * @time 2016-04-24
 * @version 1.0.11
 */
@RequestMapping(value = "/hegbk/muesr")
@Controller("mobileUserManagerAction")
public class MobileUserManagerAction {
	
	@Resource
	private MobilelUserManagerService mobilelUserManagerService;
	
	/**
	 * 移动端用户管理 -- 用户列表
	 * @param model
	 * @param likeName 用户名称（含模糊查询）
	 * @param type 用户类型
	 * @param startTime 查询开始时间
	 * @param endTime 查询截止时间
	 * @param currPage 当前页码
	 * @param pageSize 页容量
	 * @return
	 */
	@RequestMapping(value = "/ulst", method = {RequestMethod.POST, RequestMethod.GET})
	public String lst_mobileUser(Model model, 
			@RequestParam(value = "likeName", required = false) String likeName,
			@RequestParam(value = "type", required = false) String type,
			@RequestParam(value = "startTime", required = false) String startTime,
			@RequestParam(value = "endTime", required = false) String endTime,
			@RequestParam(value = "currPage", required = false) String currPage,
			@RequestParam(value = "pageSize", required = false) String pageSize){
		Integer recordCount = mobilelUserManagerService.select_userToRecord(null, null);
		PageUtils pageUtils =  mobilelUserManagerService.select_userToPage(null, null, 1, 15, recordCount);
		model.addAttribute("pageUtils", pageUtils);
		return "html/bk-content/content-user";
	}
	
	/**
	 * 根据用户Id查询
	 * @param model
	 * @param muid 用户ID
	 * @return
	 */
	@RequestMapping(value = "/bymUid", method = RequestMethod.POST)
	public String searchUser_byUid(Model model,
			@RequestParam(value = "muid", required = true) String muid){
		return null;
	}
	
	/**
	 * 根据用户Id删除用户
	 * @param model
	 * @param muid 用户ID
	 * @return
	 */
	@RequestMapping(value = "/delbyUid", method = RequestMethod.GET)
	public String del_mobileUser_ByUid(Model model,
			@RequestParam(value = "muid", required = true) String muid){
		return null;
	}
	
	/**
	 * 批量删除用户
	 * @param model
	 * @param muuids 用户ID集合
	 * @return
	 */
	@RequestMapping(value = "/batch", method = RequestMethod.GET)
	public String batchDel_mobileUser(Model model,
			@RequestParam(value = "muids", required = true) String muuids){
		return null;
	}

}
